package com.uduemc.biso.core.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.uduemc.biso.core.extities.center.Host;
import com.uduemc.biso.core.feign.fallback.HostFeignFallback;
import com.uduemc.biso.core.utils.RestResult;

@FeignClient(value = "BISO-BASIC-SERVICE", fallback = HostFeignFallback.class)
@RequestMapping(value = "/host")
public interface HostFeign {

	@GetMapping("/find-one/{id}")
	RestResult findOne(@PathVariable("id") Long id);

	@GetMapping(value = { "/find-ok-by-user-id/{userId}" })
	RestResult findOkByUserId(@PathVariable("userId") Long userId);

	@PutMapping("/update-by-id")
	public RestResult updateById(@RequestBody Host host);

	@PutMapping("/update-by-id-selective")
	public RestResult updateByIdSelective(@RequestBody Host host);

}
